package top.yihoxu.yoj.judge.codesandbox;

import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import top.yihoxu.yoj.judge.codesandbox.model.ExecuteCodeRequest;
import top.yihoxu.yoj.judge.codesandbox.model.ExecuteCodeResponse;

/**
 * @Author dth
 * @Date 2024/5/4 00:00
 * @PackageName:top.yihoxu.yoj.judge.codesandbox
 * @ClassName: CodeSandProxy
 * @Description: TODO
 * @Version 1.0
 */
@AllArgsConstructor
@Slf4j
public class CodeSandProxy implements CodeSandbox {

    private CodeSandbox codeSandbox;


    @Override
    public ExecuteCodeResponse executeCode(ExecuteCodeRequest executeCodeRequest) {
        log.info("代码沙箱执行前信息：-------------" + executeCodeRequest.getInputList());
        ExecuteCodeResponse executeCodeResponse = codeSandbox.executeCode(executeCodeRequest);
        log.info("代码沙箱执行后信息：-------------" + executeCodeResponse.getOutputList());
        return executeCodeResponse;
    }
}
